<div class="AdminStartAddPopup">
	<h1>Добавление новых виджетов</h1>
{{foreach item in widgets}}
	<div class="widget">
		<div class="image" {{if item.image}}style="background-image: url({{item.image}});"{{/if}}></div>
		<div class="info">
			<div class="name">{{item.name}}</div>
			<div class="body">{{item.body}}</div>
			<div class="action">
			{{if item.in_use}}
				<button disabled>установлен</button>
			{{else}}
				<button onclick="admin_start_widget_install({{fields.foreach_i}})">установить</button>
			{{/if}}
			</div>
		</div>
		<div class="cl"></div>
	</div>
{{/foreach}}
</div>
<script>
var widgets={{JSON:widgets}};
function admin_start_widget_install(i)
{
	var w=widgets[i];
	ajaj_post("/admin-AdminStart/",{
		ajaj:1,
		mode:"add2",
		controller_name:w.controller_name,
		controller_mode:w.controller_mode,
		fullscreen:w.fullscreen,
	},function(ret) {
		window.parent.location.reload();
	});
}

$("button").button();
</script>
